﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using ExtendedMvc.Common.EntityFramework;
using ExtendedMvc.Tests.Model.Enumerations;

namespace ExtendedMvc.Tests.Model.Entities {
	[MetadataType(typeof(DummyMetadata))]
	partial class Dummy : IBaseEntity {
	}

	public class DummyMetadata {
		[ScaffoldColumn(false)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		[ReadOnly(true)]
		public object Id { get; set; }

		public object BasicProperty { get; set; }

		[Required(AllowEmptyStrings = false, ErrorMessage = "Property is required.")]
		public object RequiredProperty { get; set; }

		[DisplayName("Labeled Property")]
		public object LabeledProperty { get; set; }

		[StringLength(240, ErrorMessage = "Property must have less than 240 characters.")]
		public object SizedProperty { get; set; }

		[RegularExpression(@"^([a-z0-9_\+-]+)((\.[a-z0-9_\+-]+)*)@([a-z0-9]([a-z0-9-]*[a-z0-9])?)((\.([a-z0-9]([a-z0-9-]*[a-z0-9])?))*)(\.([a-z]{2,6}))$", ErrorMessage = "Invalid property format.")]
		public object FormatedProperty { get; set; }

		public object BoolProperty { get; set; }

		[EnumDataType(typeof(DummyEnum))]
		public object EnumProperty { get; set; }
	}
}
